﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace ManageCategoriesProducts
{
    public partial class ErrorWindow : Window
    {
        private char operation;

        public ErrorWindow(string error, string details)
        {
            InitializeComponent();

            this.operation = '+';
            this.textBlockError.Text = error;
            this.textBoxDetails.Text = details;
        }

        private void buttonClose_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

        private void buttonDetails_Click(object sender, RoutedEventArgs e)
        {
            switch (this.operation)
            {
                case '+':
                    this.Height += 130;
                    this.operation = '-';
                    this.buttonDetails.Content = "Hide details";
                    break;
                case '-':
                    this.Height -= 130;
                    this.operation = '+';
                    this.buttonDetails.Content = "Show details";
                    break;
                default:
                    this.Close();
                    break;
            }
        }
    }
}
